package com.example.cloudconsumerconsulorder80.controller;

import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author chensixiang chensixiang1234@gmail.com
 */
@RestController
@RequestMapping("/consumer")
@RequiredArgsConstructor
public class OrderController {

    private final RestTemplate restTemplate;
    public static final String URL = "http://consul-provider-payment";

    @GetMapping("/consul")
    public String consul() {
        return restTemplate.getForObject(URL + "/payment/consul", String.class);
    }

}
